<% form_for(@course) do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :title %><br />
    <%= f.text_field :title %>
  </p>
  <p>
    <%= f.label :icon_url %><br />
    <%= f.text_field :icon_url %>
  </p>
  <p>
    <%= f.label :course_category_id %><br />
    <%= f.select :course_category_id, array_of(CourseCategory) %>
  </p>
  <p>
    <%= f.label :sector_id %><br />
    <%= f.select :sector_id, array_of(Sector) %>
  </p>
  <p>
    <%= f.label :start_date %><br />
    <%= f.date_select :start_date %>
  </p>
  <p>
    <%= f.label :end_date %><br />
    <%= f.date_select :end_date, :default => 1.year.from_now %>
  </p>
  <p>
    <%= f.label :duration %><br />
    <%= f.text_field :duration %>
  </p>
  <p>
    <%= f.label :time_category_id %><br />
    <%= f.select :time_category_id, array_of(TimeCategory) %>
  </p>
  <p>
    <%= f.label :value %><br />
    <%= f.text_field :value %>
  </p>
  <p>
    <%= f.label :currency_id %><br />
    <%= f.select :currency_id, array_of(Currency) %>
  </p>
  <p>
    <%= f.label :summary %><br />
    <%= f.text_field :summary %>
  </p>
  <p>
    <%= f.label :content %><br />
    <%= f.text_area :content %>
  </p>
  <p>
    Target Object<br />
    <% ObjectCategory.all(:order => [:title.asc]).each{ |obj| %>
      <%= check_box "object", obj.id %> <%= obj.title  %> <br />
    <% } %>
  </p>
  <p>
    <%= f.label :tags %><br />
    <%= f.text_field :tags %>
  </p>
  <p>
    <%= f.submit @course.new_record? ? 'Create' : 'Update' %>
  </p>
<% end %>